package com.bluebench.bigul.domain;


public enum Types {

	ELEMENT("element","com.itextpdf.text.Element"),
		IMAGE("image","com.itextpdf.text.Image","getInstance",Invoker.STATIC),
			PARAGRAPH("paragraph","com.itextpdf.text.Paragraph", Invoker.CONSTRUCTOR),
				CHUNK("chunk","com.itextpdf.text.Chunk",Invoker.CONSTRUCTOR),
					FONT("font","com.itextpdf.text.Font",Invoker.CONSTRUCTOR),					
						LIST("list","com.itextpdf.text.List",Invoker.CONSTRUCTOR),
							ZAPLIST("zaplist","com.itextpdf.text.ZapfDingbatsList",Invoker.CONSTRUCTOR),
								ROMANLIST("romanlist","com.itextpdf.text.RomanList",Invoker.CONSTRUCTOR),
									LISTITEM("listitem","com.itextpdf.text.ListItem",Invoker.CONSTRUCTOR),
										LISTTYPE("listtype","com.itextpdf.text.List",Invoker.FIELD),
											TABLE("table","com.itextpdf.text.pdf.PdfPTable",Invoker.CONSTRUCTOR),
												CELL_ELEMENT("cellElement","com.itextpdf.text.pdf.PdfPCell", Invoker.CONSTRUCTOR),
													TEMPLATE("template","com.bluebench.blueberry.beans.Template",Invoker.CONSTRUCTOR),
														PAGE("page","page"),
															COLOR("color","com.itextpdf.text.BaseColor",Invoker.FIELD),
																FONTFAMILY("fontfamily","com.itextpdf.text.Font$FontFamily",Invoker.ENUM),
																	FONTSTYLE("style","com.itextpdf.text.Font",Invoker.FIELD),													
																ALIGNMENT("alignment","com.itextpdf.text.Element",Invoker.FIELD),
															DEFAULT("default","java.lang.String"),
														INTEGER("int","java.lang.Integer"),
													FLOAT("float","float"),
												DOUBLE("double","double"),
											BOOLEAN("boolean","boolean"),
										HYPHENATION("hyphen","com.itextpdf.text.pdf.HyphenationAuto",Invoker.CONSTRUCTOR),
									BORDER("border","com.itextpdf.text.Rectangle",Invoker.FIELD),
								CHAPTER("chapter","com.itextpdf.text.Chapter",Invoker.CONSTRUCTOR),	
							 POINT("point", "com.bluebench.bigul.domain.graphics.Point",Invoker.CONSTRUCTOR),
						  LINE("line","com.bluebench.bigul.domain.graphics.Line",Invoker.GRAPHIC),  
						SQUARE("square","com.bluebench.bigul.domain.graphics.simple.polygon.Square",Invoker.GRAPHIC),
					  RECTANGLE("rectangle","com.bluebench.bigul.domain.graphics.simple.polygon.Rectangle",Invoker.GRAPHIC),
					TRAPEZIUM("trapezium","com.bluebench.bigul.domain.graphics.simple.polygon.Trapezium",Invoker.GRAPHIC),
				  EQUILATERAL("equilateral","com.bluebench.bigul.domain.graphics.simple.polygon.Equilateral",Invoker.GRAPHIC),
				ISOSCELES("isosceles","com.bluebench.bigul.domain.graphics.simple.polygon.Isosceles",Invoker.GRAPHIC),
			  SCALENE("scalene","com.bluebench.bigul.domain.graphics.simple.polygon.Scalene",Invoker.GRAPHIC),
			  CIRCLE("circle","com.bluebench.bigul.domain.graphics.simple.curves.Circle",Invoker.GRAPHIC),
			AXIAL("axial","com.bluebench.bigul.domain.graphics.AxialShading",Invoker.CONSTRUCTOR);
				
	
	public String type;
	public String className;
	public String staticMethodName;
	public int invocationType;
	
	

	
	private Types(String type,String classname) {
		this.type = type;
		this.className = classname;		
	}
	
	private Types(String type,String classname,int invocationType) {
		this.type = type;
		this.className = classname;
		this.invocationType = invocationType;
	}
	
	private Types(String type,String classname,String methodname,int invocationType) {
		this.type = type;
		this.className = classname;
		this.invocationType = invocationType;
		this.staticMethodName = methodname;
	}
	
	public static Types getType(String type){
		if(type.equalsIgnoreCase("image")){
			  return IMAGE;	
			}else if(type.equalsIgnoreCase("paragraph")){
				return PARAGRAPH;
			}else if(type.equalsIgnoreCase("chunk")){
				return CHUNK;
			}else if(type.equalsIgnoreCase("font")){
				return FONT;
			}else if(type.equalsIgnoreCase("template")){ // TODO : MOVE to external configuration from where 
				return TEMPLATE;
			}else if(type.equalsIgnoreCase("page")){
				return PAGE;
			}else if(type.equalsIgnoreCase("default")){
				return DEFAULT;
			}else if(type.equalsIgnoreCase("_int")){
				return INTEGER;
			}else if(type.equalsIgnoreCase("_float")){
				return FLOAT;
			}else if(type.equalsIgnoreCase("color")){
				return COLOR;
			}else if(type.equalsIgnoreCase("fontfamily")){
				return FONTFAMILY;
			}else if(type.equalsIgnoreCase("style")){
				return FONTSTYLE;
			}else if(type.equalsIgnoreCase("element")){
				return ELEMENT;
			}else if(type.equalsIgnoreCase("alignment")){
				return ALIGNMENT;
			}else if(type.equalsIgnoreCase("list")){
				return LIST;
			}else if(type.equalsIgnoreCase("zaplist")){
				return ZAPLIST;
			}else if(type.equalsIgnoreCase("romanlist")){
				return ROMANLIST;
			}else if(type.equalsIgnoreCase("listitem")){
				return LISTITEM;
			}else if(type.equalsIgnoreCase("listtype")){
				return LISTTYPE;
			}else if(type.equalsIgnoreCase("hyphen")){
				return HYPHENATION;
			}else if(type.equalsIgnoreCase("border")){
				return BORDER;
			}else if(type.equalsIgnoreCase("table")){
				return TABLE;
			}else if(type.equalsIgnoreCase("cellElement")){
				return CELL_ELEMENT;
			}else if(type.equalsIgnoreCase("chapter")){
				return CHAPTER;
			}else if(type.equalsIgnoreCase("point")){
				return POINT;
			}else if(type.equalsIgnoreCase("square")){
				return SQUARE;
			}else if(type.equalsIgnoreCase("rectangle")){
				return RECTANGLE;
			}else if(type.equalsIgnoreCase("trapezium")){
				return TRAPEZIUM;
			}else if(type.equalsIgnoreCase("equilateral")){
				return EQUILATERAL;
			}else if(type.equalsIgnoreCase("isosceles")){
				return ISOSCELES;
			}else if(type.equalsIgnoreCase("scalene")){
				return SCALENE;
			}else if(type.equalsIgnoreCase("circle")){
				return CIRCLE;
			}else if(type.equalsIgnoreCase("axial")){
				return AXIAL;
			}else{
				return DEFAULT;
			}
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public int getInvocationType() {
		return invocationType;
	}

	public void setInvocationType(int invocationType) {
		this.invocationType = invocationType;
	}

	public String getStaticMethodName() {
		return staticMethodName;
	}

	public void setStaticMethodName(String staticMethodName) {
		this.staticMethodName = staticMethodName;
	}	
	
}
